package com.platform.system.service.impl;

import java.util.List;

import com.platform.common.annotation.DataScope;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.system.mapper.ProPublicFeedbackMapper;
import com.platform.system.domain.ProPublicFeedback;
import com.platform.system.service.IProPublicFeedbackService;

/**
 * 公益捐献反馈Service业务层处理
 *
 * @author platform
 * @date 2025-02-23
 */
@Service
public class ProPublicFeedbackServiceImpl implements IProPublicFeedbackService {
    @Autowired
    private ProPublicFeedbackMapper proPublicFeedbackMapper;

    /**
     * 查询公益捐献反馈
     *
     * @param id 公益捐献反馈主键
     * @return 公益捐献反馈
     */
    @Override
    public ProPublicFeedback selectProPublicFeedbackById(Long id) {
        return proPublicFeedbackMapper.selectProPublicFeedbackById(id);
    }

    /**
     * 查询公益捐献反馈列表
     *
     * @param proPublicFeedback 公益捐献反馈
     * @return 公益捐献反馈
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ProPublicFeedback> selectProPublicFeedbackList(ProPublicFeedback proPublicFeedback) {
        return proPublicFeedbackMapper.selectProPublicFeedbackList(proPublicFeedback);
    }

    /**
     * 新增公益捐献反馈
     *
     * @param proPublicFeedback 公益捐献反馈
     * @return 结果
     */
    @Override
    public int insertProPublicFeedback(ProPublicFeedback proPublicFeedback) {
        proPublicFeedback.setCreateTime(DateUtils.getNowDate());
        return proPublicFeedbackMapper.insertProPublicFeedback(proPublicFeedback);
    }

    /**
     * 修改公益捐献反馈
     *
     * @param proPublicFeedback 公益捐献反馈
     * @return 结果
     */
    @Override
    public int updateProPublicFeedback(ProPublicFeedback proPublicFeedback) {
        proPublicFeedback.setUpdateTime(DateUtils.getNowDate());
        return proPublicFeedbackMapper.updateProPublicFeedback(proPublicFeedback);
    }

    /**
     * 批量删除公益捐献反馈
     *
     * @param ids 需要删除的公益捐献反馈主键
     * @return 结果
     */
    @Override
    public int deleteProPublicFeedbackByIds(Long[] ids) {
        return proPublicFeedbackMapper.deleteProPublicFeedbackByIds(ids);
    }

    /**
     * 删除公益捐献反馈信息
     *
     * @param id 公益捐献反馈主键
     * @return 结果
     */
    @Override
    public int deleteProPublicFeedbackById(Long id) {
        return proPublicFeedbackMapper.deleteProPublicFeedbackById(id);
    }
}
